package com.company.linkedlist;

import java.util.Stack;

/**
 * @author shenhan
 * @create 2020/1/28 11:02
 * @description
 */
public class TestStack {
    public static void main(String[] args) {
        Stack<String> stack = new Stack();
        stack.push("jack");
        stack.add("tom");
        stack.add("smith");
        //出栈
        while (stack.size() > 0) {
            System.out.println(stack.pop());
        }
    }
}
